package domotica.scontrol.rcp;

import java.util.Vector;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

public class ContentProvider implements IStructuredContentProvider {
private Vector<String> messages = new Vector<String>(10);

private static ContentProvider cp = null;

	public static ContentProvider getViewContentProvider(){
		if( cp == null) 
			cp = new ContentProvider();
		return cp;
	}
	
	public synchronized void inputChanged(Viewer v, Object oldInput, Object newInput) {
		messages.add("" + newInput);
	}
	
	public void dispose() {
	}
	
	public synchronized Object[] getElements(Object parent) {
		return messages.toArray();
	}	
}
